package com.zj.blessings.util;

import java.io.FileOutputStream;
import java.io.IOException;
import java.io.InputStream;
import android.content.Context;
import android.os.Environment;
import com.zj.blessings.R;

public class FileUtils {
	public static String desPath = Environment.getExternalStorageDirectory()
			.getAbsolutePath() + "/share.png";

	public static String getFilePath() {
		return desPath;
	}

	public static void initSharePath(Context context) {
		FileOutputStream fos = null;
		InputStream is = null;
		try {
			fos = new FileOutputStream(desPath);
			is = context.getResources().openRawResource(R.raw.share);
			int i;
			while ((i = is.read()) != -1) {
				fos.write(i);
				fos.flush();
			}
		} catch (Exception e) {
			e.printStackTrace();
		} finally {
			try {
				is.close();
				fos.close();
			} catch (IOException e) {
				e.printStackTrace();
			}
		}
	}
}
